package com.example.demo;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;


@Configuration
public class Swagger2 {
    
	@Bean
	public Docket smsApi() {
		return new Docket(DocumentationType.SWAGGER_2).groupName("测试接口").forCodeGeneration(true).select().apis(RequestHandlerSelectors.any())
				.paths(PathSelectors.regex("/api/test/.*"))
				.build().apiInfo(apiInfo());
	}
	
	private ApiInfo apiInfo() {
		return new ApiInfoBuilder()
				.title("测试模块")
				.description("")
				.version("1.0")
				.build();
	}
	

	
}
